package com.hua.scanner;

import java.util.Scanner;

public class Demo02 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("使用nextline方式接收：");//获取输入回车之前的所有字符
        if (scanner.hasNextLine()){
            String str = scanner.nextLine();
            System.out.println(str);
        }
        scanner.close();
    }
}
